package lumingweihua.future.cn.lumingweihua;

import android.content.Context;
import android.graphics.Bitmap;
import android.support.multidex.MultiDex;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.mob.MobSDK;
import com.tencent.bugly.crashreport.CrashReport;
import com.zhusx.core.manager.ZsxApplicationManager;

import cn.jpush.android.api.JPushInterface;
import lumingweihua.future.cn.baselibgxh.base.MyApplication;
import lumingweihua.future.cn.baselibgxh.utils.ForceCloseHandler;

/**
 * Author       zhusx
 * Email        327270607@qq.com
 * Created      2018/3/16 17:41
 */

public class AppApplication extends MyApplication {
    @Override
    public void onCreate() {
//        SharedPreference.saveToSP(this, "userToken", "cb97a780c081a49154bed3aa50842ff4");
        super.onCreate();
        Fresco.initialize(this, ImagePipelineConfig.newBuilder(this)
                .setDownsampleEnabled(true)
                .setBitmapsConfig(Bitmap.Config.ARGB_8888)
                .build());
        ZsxApplicationManager.builder(this).setMonitorNet(true).setLogDebug(BuildConfig.DEBUG).build();
        JPushInterface.init(this);
        JPushInterface.setDebugMode(BuildConfig.DEBUG);
        MobSDK.init(this);

        ForceCloseHandler.getInstance().init(this);
        if (!BuildConfig.DEBUG) {
            CrashReport.initCrashReport(getApplicationContext(), "3ee2976494", false);
        }
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        //支持多Dex
        MultiDex.install(this);
    }
}
